﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "IEventArgs.h"
#include "ElementId.h"
#include "RuntimeId.h"


namespace gcmp
{
    /// \brief 模型视图事件类型
    ///
    enum class ModelViewEventType : int32_t
    {
        PreClosed = 0,                          ///< 视图将要关闭
        RangeUpdated = 1,                       ///< 视图范围发生变化
        NameChanged = 2,                        ///< 视图名称发生变化
        ScaleChanged = 3,                       ///< 视图比例发生变化
        DetailLevelChanged = 4,                 ///< 视图细节度发生变化
        DisplayOptionChanged = 5,               ///< 视图显示配置发生变化
        DrawingModeChanged = 6,                 ///< 出图模式发生变化
        EditableGrepsChanged = 7,               ///< 可编辑Grep集合发生变化
        DisplayModelChanged = 8,                ///< 视图显示模式发生变化
        CropBoxChanged = 9,                     ///< 裁剪框发生变化
        DiscreteEpsilonChanged = 10,            ///< 视图级离散精度发生变化
        ModelViewRotated = 11,                  ///< 视图发生旋转
        ReplaceModeChanged = 12                 ///< 视图显示替换模式发生变化
    };

    /// \brief 视图范围更新部分
    ///
    /// 视图范围更新部分
    enum class ModelViewRangeChangePart : int32_t
    {
        ViewportRange = 1 << 0,                     ///< 视口
        Other = 1 << 1,                             ///< 其他
    };
    
    /// \brief  模型视图事件参数
    ///
    class GCMP_MODEL_INTERFACE_EXPORT IModelViewEventArgs : public IEventArgs
    {
    public:
 
        ///  \brief 获取模型视图事件类型
        ///
        /// \return 模型视图事件类型
        virtual ModelViewEventType GetType() const = 0;

        ///  \brief 获取文档的运行时Id
        ///
        /// \return 文档运行时Id
        virtual RuntimeId GetDocumentRuntimeId() const = 0;

        ///  \brief 获取视图的Id
        ///
        /// \return 视图Id
        virtual ElementId GetModelViewId() const = 0;

        ///  \brief 获取视图范围更新部分
        ///
        /// \return 视图范围更新部分
        virtual int GetModelViewRangeChangeParts() const = 0;
    };
}

